<?php

namespace App\Http\Api\Controllers;

use App\Http\Api\Services\MateService;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;


class MateController extends Controller
{
    protected $mateService;

    public function __construct(MateService $mateService)
    {
        $this->mateService = $mateService;
    }

    /*
     * 素材采集 from有好货
     * */
    public function store(Request $request)
    {
        $attributes = $request->all();

        $result = $this->mateService->store($attributes);

        return res('采集完成', $result);
    }

    /*
     * 素材id采集
     * */
    public function listStore(Request $request)
    {
        $attributes = $request->all();

        $result = $this->mateService->listStore($attributes);

        return res('采集完成', $result);
    }

    /*
     * 返content_id
     * */
    public function contentId(Request $request)
    {
        $platform = $request->input('platform');
        $result = $this->mateService->contentId($platform);
        return res('获取完成', $result);
    }

}
